<table border="0">
<tr> 
	<td colspan="2"> <div align="left">
<div class="bbbut">
 <a class="bbb" href="javascript:void(0)" title="Жирный : [b]text[/b]" onmousedown="addTags('[b]','[/b]','')">Жирный</a>
 </div><div class="bbbut">
 <a class="bbi" href="javascript:void(0)" title="Курсив : [i]text[/i]" onmousedown="addTags('[i]','[/i]','')">Курсив</a>
 </div><div class="bbbut">
 <a class="bbu" href="javascript:void(0)" title="Подчекрнутый : [u]text[/u]" onmousedown="addTags('[u]','[/u]','')">Подчекрнутый</a>
  </div><div class="bbbut">
 <a class="bbs" href="javascript:void(0)" title="Перечекрнутый : [s]text[/s]" onmousedown="addTags('[s]','[/s]','')">Перечекрнутый</a>
  </div><div class="bbbut">
 <a class="bbsup" href="javascript:void(0)" title="Надстрочный : [sup]text[/sup]" onmousedown="addTags('[sup]','[/sup]','')">Надстрочный</a>
  </div><div class="bbbut">
 <a class="bbsub" href="javascript:void(0)" title="Подстрочный : [sub]text[/sub]" onmousedown="addTags('[sub]','[/sub]','')">Подстрочный</a>
  </div><div class="bbbut">
  <a class="bbhr" href="javascript:void(0)" title="Линия : [hr]" onmousedown="addText('[hr]','')">Линия</a>
  </div><div class="bbbut">
  <a class="bbl" href="javascript:void(0)" title="По левому краю : [align=left]text[/align]" onmousedown="addTags('[align=left]','[/align]','')">По левому краю</a>
  </div><div class="bbbut">
  <a class="bbc" href="javascript:void(0)" title="По центру : [align=center]text[/align]" onmousedown="addTags('[align=center]','[/align]','')">По центру</a>
  </div><div class="bbbut">
  <a class="bbr" href="javascript:void(0)" title="По правому краю : [align=right]text[/align]" onmousedown="addTags('[align=right]','[/align]','')">По правому краю</a>
  </div><div class="bbbut">
  <a class="bbj" href="javascript:void(0)" title="По ширине : [align=justify]text[/align]" onmousedown="addTags('[align=justify]','[/align]','')">По ширине</a>
  </div><div class="bbbut">
  <a class="bburl" href="javascript:void(0)" title="Ссылка : [url]url[/url]" onmousedown="addTags('[url]','[/url]','')">Ссылка</a>
  </div><div class="bbbut">
  <a class="bbimg" href="javascript:void(0)" title="Изображение : [img]url[/img]" onmousedown="addTags('[img]','[/img]','')">Изображение</a>
  </div><div class="bbbut">
  <a class="bbsm" href="javascript:void(0)" title="Смайлы" onmousedown="Show('smile')">Смайлы</a>
  </div><div class="bbbut">
  <a class="bbcol" href="javascript:void(0)" title="Цвет текста : [color=цвет]','[/color]" onmousedown="Show('color')">Цвет текста</a>
  </div><div class="bbbut">
  <a class="bbqot" href="javascript:void(0)" title="Цитата : [quote]text[/quote]" onmousedown="addTags('[quote]','[/quote]','')">Цитата</a>
  </div><div class="bbbut">
  <a class="bbcod" href="javascript:void(0)" title="Код : [code]text[/code]" onmousedown="addTags('[code]','[/code]','')">Код</a>
 </div> 
<select title="Размер шрифта: [SIZE=85]small text[/SIZE]" onchange="addTags('[SIZE=' + this.form.size.options[this.form.size.selectedIndex].value + ']','[/SIZE]','')" name="size">
		<option value="6">Очень маленький</option>
		<option value="9">Маленький</option>
		<option selected="selected" value="12">Нормальный</option>
		<option value="18">Большой</option>
		<option value="24">Очень большой</option>
        <option value="36">Огромный</option>
	</select>
   <br />
	<textarea id="text" name="text" style="width: 500px; height: 250px;"><?php if(isset($contact)){echo $contact;} ?></textarea><br />
       
	</div></td>
	<td valign="top">
<br />

<div id="color" style="position: absolute; display: none;"><br />

<table cellspacing="1" cellpadding="0" border="0">
<tbody>
    <tr>
    
<?php
for($r=0;$r<300;$r=$r+33)
{
for($g=0;$g<300;$g=$g+33)
{
for($b=0;$b<300;$b=$b+33)
{
	$rc=$r;
	$gc=$g;
	$bc=$b;
	
	if ($r==132 ) {$rc='AA';continue;}
	if ($g==132 ) {$gc='AA';continue;}
	if ($b==132 ) {$bc='AA';continue;}
	
	if ($r==165 ) {$rc='BB';continue;}
	if ($g==165 ) {$gc='BB';continue;}
	if ($b==165 ) {$bc='BB';continue;}
	
	if ($r==198 ) {$rc='CC';}
	if ($g==198 ) {$gc='CC';}
	if ($b==198 ) {$bc='CC';}
	
	if ($r==231 ) {$rc='DD';continue;}
	if ($g==231 ) {$gc='DD';continue;}
	if ($b==231 ) {$bc='DD';continue;}
	
	if ($r==264 ) {$rc='EE';continue;}
	if ($g==264 ) {$gc='EE';continue;}
	if ($b==264 ) {$bc='EE';continue;}
	
	if ($r==297 ) {$rc='FF';}
	if ($g==297 ) {$gc='FF';}
	if ($b==297 ) {$bc='FF';}
	
	if ($r==0 ) {$rc='00';}
	if ($g==0 ) {$gc='00';}
	if ($b==0 ) {$bc='00';}
	?>
    <td class="color" width="10" height="10" bgcolor="#<?php echo $rc.$gc.$bc; ?>"> <img width="10" height="10" border="0"  title="[color=<?php echo $rc.$gc.$bc; ?>]text[/color]" onmousedown="addTags('[color=<?php echo$rc.$gc.$bc; ?>]','[/color]','')" alt="#<?php echo $rc.$gc.$bc; ?>" src="pix.gif" style ="bgcolor:#<?php echo$rc.$gc.$bc; ?>;" /></td>
	<?php
	if ($bc=='FF') {$bcc++;};
	if ($bcc==3) {$bcc=0; echo '<tr></tr>';};
}
}
}

?>
</tr>
</tbody></table>
<a href="javascript:void(0)" title="Скрыть" onmousedown="Show('color')">Скрыть</a>
</div>

		<div id="smile" style="position: absolute; display: none;">
<table cellspacing="1" cellpadding="0" border="0">
<tbody>
<tr>
<td width="20" height="20"><a onclick="addText('O:-)','')" href="#"><img border="0" src="/images/smiles/1.gif" alt="O:-)"></a></td>

<td width width="20" height="20"><a onclick="addText(':)','')" href="#"><img border="0" src="/images/smiles/2.gif" alt=":)"></a></td>

<td width width width="20" height="20"><a onclick="addText(':(','')" href="#"><img border="0" src="/images/smiles/3.gif" alt=":("></a></td>

<td width width width="20" height="20"><a onclick="addText(';)','')" href="#"><img border="0" src="/images/smiles/4.gif" alt=";)"></a></td>

<td width width width="20" height="20"><a onclick="addText(':P','')" href="#"><img border="0" src="/images/smiles/5.gif" alt=":P"></a></td>

<td width width width="20" height="20"><a onclick="addText(':8)','')" href="#"><img border="0" src="/images/smiles/6.gif" alt=":8)"></a></td>

<td width width width="20" height="20"><a onclick="addText(':D','')" href="#"><img border="0" src="/images/smiles/7.gif" alt=":D"></a></td>

<td width="20" height="20"><a onclick="addText(':arrow:','')" href="#"><img border="0" src="/images/smiles/50.gif" alt=":arrow:"></a></td>

<td width="20" height="20"><a onclick="addText(':gamer:','')" href="#"><img border="0" src="/images/smiles/57.gif" alt=":gamer:"></a></td>

</tr><tr>

<td width="20" height="20"><a onclick="addText(':-[','')" href="#"><img border="0" src="/images/smiles/8.gif" alt=":-["></a></td>

<td width width width="20" height="20"><a onclick="addText(':O','')" href="#"><img border="0" src="/images/smiles/9.gif" alt=":O"></a></td>

<td width width width="20" height="20"><a onclick="addText(':*','')" href="#"><img border="0" src="/images/smiles/10.gif" alt=":*"></a></td>

<td width width width="20" height="20"><a onclick="addText(':cry:','')" href="#"><img border="0" src="/images/smiles/11.gif" alt=":cry:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':-X','')" href="#"><img border="0" src="/images/smiles/12.gif" alt=":-X"></a></td>

<td width width width="20" height="20"><a onclick="addText('&gt;:o','')" href="#"><img border="0" src="/images/smiles/13.gif" alt="&gt;:o"></a></td>

<td width width width="20" height="20"><a onclick="addText(':-|','')" href="#"><img border="0" src="/images/smiles/14.gif" alt=":-|"></a></td>

<td width width width="20" height="20"><a onclick="addText(':study:','')" href="#"><img border="0" src="/images/smiles/51.gif" alt=":study:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':victory:','')" href="#"><img border="0" src="/images/smiles/58.gif" alt=":victory:"></a></td>

</tr><tr>

<td width="20" height="20"><a onclick="addText(':-/','')" href="#"><img border="0" src="/images/smiles/15.gif" alt=":-/"></a></td>

<td width width width="20" height="20"><a onclick="addText(':jokingly:','')" href="#"><img border="0" src="/images/smiles/16.gif" alt=":jokingly:"></a></td>

<td width width width="20" height="20"><a onclick="addText(']:-&gt;','')" href="#"><img border="0" src="/images/smiles/17.gif" alt="]:-&gt;"></a></td>

<td width width width="20" height="20"><a onclick="addText('[:-}','')" href="#"><img border="0" src="/images/smiles/18.gif" alt="[:-}"></a></td>

<td width width width="20" height="20"><a onclick="addText(':kissed:','')" href="#"><img border="0" src="/images/smiles/19.gif" alt=":kissed:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':-!','')" href="#"><img border="0" src="/images/smiles/20.gif" alt=":-!"></a></td>

<td width width width="20" height="20"><a onclick="addText(':tired:','')" href="#"><img border="0" src="/images/smiles/21.gif" alt=":tired:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':bead:','')" href="#"><img border="0" src="/images/smiles/52.gif" alt=":bead:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':search:','')" href="#"><img border="0" src="/images/smiles/59.gif" alt=":search:"></a></td>

</tr><tr>

<td width="20" height="20"><a onclick="addText(':stop:','')" href="#"><img border="0" src="/images/smiles/22.gif" alt=":stop:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':kissind:','')" href="#"><img border="0" src="/images/smiles/23.gif" alt=":kissind:"></a></td>

<td width width width="20" height="20"><a onclick="addText('@}-&gt;--','')" href="#"><img border="0" src="/images/smiles/24.gif" alt="@}-&gt;--"></a></td>

<td width width width="20" height="20"><a onclick="addText(':thumbs_up:','')" href="#"><img border="0" src="/images/smiles/25.gif" alt=":thumbs_up:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':drink:','')" href="#"><img border="0" src="/images/smiles/26.gif" alt=":drink:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':in_love:','')" href="#"><img border="0" src="/images/smiles/27.gif" alt=":in_love:"></a></td>

<td width width width="20" height="20"><a onclick="addText('@=','')" href="#"><img border="0" src="/images/smiles/28.gif" alt="@="></a></td>

<td width width width="20" height="20"><a onclick="addText(':close:','')" href="#"><img border="0" src="/images/smiles/53.gif" alt=":close:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':umnik:','')" href="#"><img border="0" src="/images/smiles/60.gif" alt=":umnik:"></a></td>

</tr><tr>

<td width="20" height="20"><a onclick="addText(':happy:','')" href="#"><img border="0" src="/images/smiles/29.gif" alt=":happy:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':new_russian:','')" href="#"><img border="0" src="/images/smiles/30.gif" alt=":new_russian:"></a></td>

<td width width width="20" height="20"><a onclick="addText('%-)','')" href="#"><img border="0" src="/images/smiles/31.gif" alt="%-)"></a></td>

<td width width width="20" height="20"><a onclick="addText(':OK:','')" href="#"><img border="0" src="/images/smiles/32.gif" alt=":OK:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':wassup:','')" href="#"><img border="0" src="/images/smiles/33.gif" alt=":wassup:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':sorry:','')" href="#"><img border="0" src="/images/smiles/34.gif" alt=":sorry:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':bravo:','')" href="#"><img border="0" src="/images/smiles/35.gif" alt=":bravo:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':gift:','')" href="#"><img border="0" src="/images/smiles/54.gif" alt=":gift:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':school:','')" href="#"><img border="0" src="/images/smiles/61.gif" alt=":school:"></a></td>

</tr><tr>

<td width="20" height="20"><a onclick="addText(':rofl:','')" href="#"><img border="0" src="/images/smiles/36.gif" alt=":rofl:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':pardon:','')" href="#"><img border="0" src="/images/smiles/37.gif" alt=":pardon:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':no:','')" href="#"><img border="0" src="/images/smiles/38.gif" alt=":no:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':crazy:','')" href="#"><img border="0" src="/images/smiles/39.gif" alt=":crazy:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':dont_know:','')" href="#"><img border="0" src="/images/smiles/40.gif" alt=":dont_know:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':dance:','')" href="#"><img border="0" src="/images/smiles/41.gif" alt=":dance:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':yahoo:','')" href="#"><img border="0" src="/images/smiles/42.gif" alt=":yahoo:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':mobile:','')" href="#"><img border="0" src="/images/smiles/55.gif" alt=":mobile:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':teacher:','')" href="#"><img border="0" src="/images/smiles/62.gif" alt=":teacher:"></a></td>

</tr><tr>

<td width="20" height="20"><a onclick="addText(':hi:','')" href="#"><img border="0" src="/images/smiles/43.gif" alt=":hi:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':bye:','')" href="#"><img border="0" src="/images/smiles/44.gif" alt=":bye:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':yes:','')" href="#"><img border="0" src="/images/smiles/45.gif" alt=":yes:"></a></td>

<td width width width="20" height="20"><a onclick="addText(';D','')" href="#"><img border="0" src="/images/smiles/46.gif" alt=";D"></a></td>

<td width width width="20" height="20"><a onclick="addText(':wall:','')" href="#"><img border="0" src="/images/smiles/47.gif" alt=":wall:"></a></td>

<td width width width="20" height="20"><a onclick="addText('help:','')" href="#"><img border="0" src="/images/smiles/48.gif" alt="help:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':scratch:','')" href="#"><img border="0" src="/images/smiles/49.gif" alt=":scratch:"></a></td>

<td width width width="20" height="20"><a onclick="addText(':examen:','')" href="#"><img border="0" src="/images/smiles/56.gif" alt=":examen:"></a></td>


</tr></tbody></table>
<a href="#"
 onclick="Show('smile')">
Скрыть</a>
 </div>
        
</tr>

</table>

<input type="submit" name="preveiw"  onClick="this.form.action = 'preview.php';this.form.target='preview'" value="Предварительный просмотр">